home *** CD-ROM | disk | FTP | other *** search
/ Run Magazine ReRun 1986 November & December / rerun-1986-11-12.d64 / sum fun 64 (.txt) < prev   
Commodore BASIC  |  2022-09-20  |  5KB  |  190 lines

  1. 10 xx=rnd(-ti):u=370370367:printchr$(142)chr$(8):goto110
  2. 20 getnu$
  3. 30 ifnu$="1"ornu$="2"ornu$="3"ornu$="4"ornu$="5"then100
  4. 40 ifnu$="6"ornu$="7"ornu$="8"ornu$="9"ornu$=chr$(133)then100
  5. 50 printchr$(18)chr$(32)chr$(146)chr$(157);:t2=ti+15
  6. 60 ifti<t2then60
  7. 70 printchr$(32)chr$(157);:t2=ti+15
  8. 80 ifti<t2then80
  9. 90 goto20
  10. 100 return
  11. 110 gosub1880:gosub1660:poke53280,1:poke53281,1
  12. 120 print"[147]            shut the boxes":fort=1to2000:next
  13. 130 print"[154][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  14. 140 print" * important reminder... "
  15. 150 print"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  16. 160 print" * press f1 when none of the boxes    "
  17. 170 print"[164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  18. 180 print" * match the roll of your dice        ":fort=1to4000:next
  19. 190 ifu=370370367then210
  20. 200 print"[158][147]"u:print"             shut the boxes":goto220
  21. 210 print"[147]             shut the boxes"
  22. 220 printbx$(1):printbx$(2):printbx$(3)+"":printbx$(4):printbx$(4):printbx$(4)
  23. 230 dc=45
  24. 240 ifdc<7thengosub1550:goto260
  25. 250 gosub1370
  26. 260 print""sq$"[145] select your box(es)"
  27. 270 printl$(1):printl$(2):printl$(3):printl$(4):printl$(5):printl$(6)
  28. 280 du=0:pch=0:c=1
  29. 290 print""sq$" shut box number ? ";
  30. 300 gosub20
  31. 310 printnu$:ifnu$=chr$(133)then1000
  32. 320 nu=val(nu$):su=nu:gosub970
  33. 330 ifpch=1thengosub1330
  34. 340 ifdu=1thengosub1320:goto260
  35. 350 ifnu>ttthenprint"[156] choice too large!!!":du=1:gosub1860:goto340
  36. 360 ifnu<ttthen380
  37. 370 uv=nu:goto730
  38. 380 gosub1340
  39. 390 print"   and what else ? ";
  40. 400 gosub20
  41. 410 printnu$:ifnu$=chr$(133)then1000
  42. 420 el=val(nu$):su=el:gosub970
  43. 430 ifpch=1thengosub1330
  44. 440 ifdu=1thengosub1320:goto260
  45. 450 ifel=nuthengosub1350:goto440
  46. 460 uv=el+nu
  47. 470 ifuv>ttthengosub1360:goto440
  48. 480 ifuv<ttthen500
  49. 490 goto730
  50. 500 gosub1340
  51. 510 print"  choose another ? ";
  52. 520 gosub20
  53. 530 printnu$:ifnu$=chr$(133)then1000
  54. 540 ca=val(nu$):su=ca:gosub970
  55. 550 ifpch=1thengosub1330
  56. 560 ifdu=1thengosub1320:goto260
  57. 570 ifca=nuorca=elthengosub1350:goto560
  58. 580 uv=uv+ca
  59. 590 ifuv>ttthengosub1360:goto560
  60. 600 ifuv<ttthen620
  61. 610 goto730
  62. 620 gosub1340
  63. 630 print"your last choice ? ";
  64. 640 gosub20
  65. 650 printnu$:ifnu$=chr$(133)then1000
  66. 660 lc=val(nu$):su=lc:gosub970
  67. 670 ifpch=1thengosub1330
  68. 680 ifdu=1thengosub1320:goto260
  69. 690 iflc=nuorlc=elorlc=cathengosub1350:goto680
  70. 700 uv=uv+lc
  71. 710 ifuv>ttthengosub1360:goto680
  72. 720 ifuv<ttthenprint" only 4 choices are allowed!":c=c-1:du=1:gosub1860:goto680
  73. 730 print"[156] that's a match!"
  74. 740 dc=dc-uv
  75. 750 oncgoto790,780,770,760
  76. 760 letw=lc:goto800
  77. 770 letw=ca:goto800
  78. 780 letw=el:goto800
  79. 790 letw=nu:goto800
  80. 800 gosub850
  81. 810 ifc>0then750
  82. 820 ifdc=0thengosub1820:goto1000
  83. 830 fort=1to1000:next
  84. 840 goto240
  85. 850 c=c-1
  86. 860 r=(w-1)*4
  87. 870 readx,y,a,b
  88. 880 ifx=-1thenrestore:return
  89. 890 ifx=9thengosub1800:goto870
  90. 900 poke1024+(x+r)+40*(y),a
  91. 910 poke55296+(x+r)+40*(y),b
  92. 920 goto870
  93. 930 data2,5,160,5,2,8,76,6,3,5,160,5,3,8,111,6,4,5,160,5,4,8,122,6,9,9,9,9
  94. 940 data4,4,160,5,4,7,106,6,3,4,160,5,3,7,160,1,2,4,160,5,2,7,116,6,9,9,9,9
  95. 950 data2,3,160,5,2,6,116,6,3,3,160,5,3,6,160,1,4,3,160,5,4,6,106,6,9,9,9,9
  96. 960 data-1,-1,-1,-1
  97. 970 ifpeek(1187+(su-1)*4)=160then990
  98. 980 return
  99. 990 pch=1:return
  100. 1000 b$(1)="":b$(2)="":b$(3)="":b$(4)="":b$(5)="":b$(6)="":b$(7)="":b$(8)=""
  101. 1010 b$(9)=""
  102. 1020 printl$(1):printl$(2):printl$(3):printl$(4):printl$(5)
  103. 1030 printsq$+""
  104. 1040 print"[158]          **** scoreboard ****"
  105. 1050 forpk=1to9
  106. 1060 ifpeek(1187+(pk-1)*4)<>160thenb$(pk)=chr$(48+pk)
  107. 1070 nextpk
  108. 1080 q=q+1
  109. 1090 sk$=b$(1)+b$(2)+b$(3)+b$(4)+b$(5)+b$(6)+b$(7)+b$(8)+b$(9)
  110. 1100 p1=val(sk$)
  111. 1110 fs=fs+p1:ifdc=0thenfs=0
  112. 1120 ifq=3thenprint" your final score is";fs:goto1160
  113. 1130 print" your score so far is";fs
  114. 1140 fori=1to3000:next
  115. 1150 goto190
  116. 1160 print" game over...play again <y/n> ?"
  117. 1170 iffs<=uthenprint"          "
  118. 1180 iffs<=uthenprint"[158]"fs"  best low score so far!":gosub1820
  119. 1190 poke781,23:poke782,32:poke783,0:sys65520
  120. 1200 getyn$:ifyn$="y"oryn$="n"then1260
  121. 1210 printchr$(18)chr$(32)chr$(146)chr$(157);:t2=ti+15
  122. 1220 ifti<t2then1220
  123. 1230 printchr$(32)chr$(157);:t2=ti+15
  124. 1240 ifti<t2then1240
  125. 1250 goto1200
  126. 1260 printyn$:ifyn$="y"thenclr:gosub1280:goto110
  127. 1270 print"[147]                the end!":end
  128. 1280 forh=1024to1033
  129. 1290 u$=u$+chr$(peek(h))
  130. 1300 next
  131. 1310 u=val(u$):return
  132. 1320 print"[158] let's start over again.":fort=1to2000:next:return
  133. 1330 print" you already picked that box!":c=c-1:du=1:gosub1860:return
  134. 1340 c=c+1:du=0:pch=0:return
  135. 1350 print" you can't pick same box twice!":c=c-1:du=1:gosub1860:return
  136. 1360 print" your last choice was too large.":c=c-1:du=1:gosub1860:return
  137. 1370 printsq$"[145]"bk$"[144]"
  138. 1380 fori=1to8
  139. 1390 d1=int(6*rnd(1)+1)
  140. 1400 d2=int(6*rnd(1)+1)
  141. 1410 printrq$spc(14);
  142. 1420 ond1gosub1490,1500,1510,1520,1530,1540
  143. 1430 printrq$spc(20);
  144. 1440 ond2gosub1490,1500,1510,1520,1530,1540
  145. 1450 gosub1780
  146. 1460 nexti
  147. 1470 tt=d1+d2
  148. 1480 return
  149. 1490 printd$(1);:printd$(2);:printd$(3);:printd$(2);:printd$(4):return
  150. 1500 printd$(1);:printd$(5);:printd$(2);:printd$(6);:printd$(4):return
  151. 1510 printd$(1);:printd$(5);:printd$(3);:printd$(6);:printd$(4):return
  152. 1520 printd$(1);:printd$(7);:printd$(2);:printd$(7);:printd$(4):return
  153. 1530 printd$(1);:printd$(7);:printd$(3);:printd$(7);:printd$(4):return
  154. 1540 printd$(1);:printd$(8);:printd$(2);:printd$(8);:printd$(4):return
  155. 1550 printrq$+bk$:printrq$+""+bk$:printrq$+""+bk$:printrq$+""+bk$
  156. 1560 printrq$+""+bk$:printrq$+""+bk$:print"[144]"
  157. 1570 fori=1to8
  158. 1580 d1(i)=int(6*rnd(1)+1)
  159. 1590 ifd1(i)=d1(i-1)then1580
  160. 1600 printrq$spc(17);
  161. 1610 ond1(i)gosub1490,1500,1510,1520,1530,1540
  162. 1620 gosub1780
  163. 1630 nexti
  164. 1640 tt=d1(8)
  165. 1650 return
  166. 1660 bx$(1)="  [207][183][208] [207][183][208] [207][183][208] [207][183][208] [207][183][208] [207][183][208] [207][183][208] [207][183][208] [207][183][208]"
  167. 1670 bx$(2)="  [180]1[170] [180]2[170] [180]3[170] [180]4[170] [180]5[170] [180]6[170] [180]7[170] [180]8[170] [180]9[170]"
  168. 1680 bx$(3)="  [180] [170] [180] [170] [180] [170] [180] [170] [180] [170] [180] [170] [180] [170] [180] [170] [180] [170]"
  169. 1690 bx$(4)="     [146]    [146]    [146]    [146]    [146]    [146]    [146]    [146]    [146]"
  170. 1700 rq$="":sq$=""
  171. 1710 bk$="                                       "
  172. 1720 l$(1)=sq$+bk$:l$(2)=sq$+""+bk$:l$(3)=sq$+""+bk$:l$(4)=sq$+""+bk$
  173. 1730 l$(5)=sq$+""+bk$:l$(6)=sq$+""+bk$
  174. 1740 d$(1)="[207][183][183][183][208][157][157][157][157][157]":d$(2)="[180]   [170][157][157][157][157][157]":d$(3)="[180] [209] [170][157][157][157][157][157]"
  175. 1750 d$(4)="[204][175][175][175][186]":d$(5)="[180][209]  [170][157][157][157][157][157]":d$(6)="[180]  [209][170][157][157][157][157][157]":d$(7)="[180][209] [209][170][157][157][157][157][157]"
  176. 1760 d$(8)="[180][209][209][209][170][157][157][157][157][157]"
  177. 1770 return
  178. 1780 v=54296:w=54276:a=54277:h=54273:l=54272:forx=5to0step-1:pokev,x:pokew,129
  179. 1790 pokea,15:pokeh,200:pokel,200:next:pokew,0:pokea,0:return
  180. 1800 v=54296:w=54276:a=54277:h=54273:l=54272:ph=54275:pokev,5:pokew,65:pokea,15
  181. 1810 pokeph,15:form=20to5step-2:pokeh,40:pokel,m:next:pokew,0:return
  182. 1820 forl=1to10step1:poke54296,15:poke54273,40:poke54277,9:poke54278,0
  183. 1830 poke54276,17:fort=1to100:next:poke54276,16:nextl:poke54296,15:poke54273,40
  184. 1840 poke54277,9:poke54278,0:poke54276,17:fort=1to200:next:poke54276,16
  185. 1850 poke54296,00:gosub1880:return
  186. 1860 poke54296,5:poke54273,5:poke54277,0:poke54278,240:poke54276,33
  187. 1870 fort=1to1000:next:poke54276,32:poke54296,0:return
  188. 1880 poke54296,0:poke54273,5:poke54277,0:poke54278,240:poke54276,33
  189. 1890 fort=1to10:next:poke54276,32:poke54296,0:return
  190.